<?php 
namespace app\modules\admin\models;

use Yii;
use yii\base\Model;
use yii\midules\Article;
class LoginForm  extends Model {


    public static function dologin($userName,$userPwd){
        // $data = \Yii::$app->db->createCommand('SELECT * FROM `t_admin`')->queryAll();
        // var_dump($data);
        $sql =  '  SELECT * FROM {{%admin}} WHERE user_name = :user_name '; 
        $data = YII::$app->db->createCommand($sql, ['user_name' => $userName])->queryOne();
       // var_dump($data);
        return  $data;
    }
    

}